package com.shanjiduo.newsline.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Administrator on 2017/1/13.
 */

public class MovieSummary implements Parcelable {

    public static final Parcelable.Creator<MovieSummary> CREATOR = new Parcelable.Creator<MovieSummary>() {
        @Override
        public MovieSummary createFromParcel(Parcel source) {
            return new MovieSummary(source);
        }

        @Override
        public MovieSummary[] newArray(int size) {
            return new MovieSummary[size];
        }
    };
    public String cover;
    public String description;
    public int length;
    public String m3u8Hd_url;
    public String m3u8_url;
    public String mp4Hd_url;
    public String mp4_url;
    public int playCount;
    public int playersize;
    public String ptime;
    public String replyBoard;
    public String replyid;
    public String sectiontitle;
    public String title;
    public String topicDesc;
    public String topicImg;
    public String topicName;
    public VideoTopic videoTopic;
    public String vid;
    public String topicSid;
    public String videosource;

    public MovieSummary() {
    }

    protected MovieSummary(Parcel in) {
        this.cover = in.readString();
        this.description = in.readString();
        this.length = in.readInt();
        this.m3u8Hd_url = in.readString();
        this.m3u8_url = in.readString();
        this.mp4Hd_url = in.readString();
        this.mp4_url = in.readString();
        this.playCount = in.readInt();
        this.playersize = in.readInt();
        this.ptime = in.readString();
        this.replyBoard = in.readString();
        this.replyid = in.readString();
        this.sectiontitle = in.readString();
        this.title = in.readString();
        this.topicDesc = in.readString();
        this.topicImg = in.readString();
        this.topicName = in.readString();
        this.videoTopic = in.readParcelable(VideoTopic.class.getClassLoader());
        this.vid = in.readString();
        this.topicSid = in.readString();
        this.videosource = in.readString();
    }

    @Override
    public String toString() {
        return "MovieSummary{" +
                "cover='" + cover + '\'' +
                ", description='" + description + '\'' +
                ", length=" + length +
                ", m3u8Hd_url='" + m3u8Hd_url + '\'' +
                ", m3u8_url='" + m3u8_url + '\'' +
                ", mp4Hd_url='" + mp4Hd_url + '\'' +
                ", mp4_url='" + mp4_url + '\'' +
                ", playCount=" + playCount +
                ", playersize=" + playersize +
                ", ptime='" + ptime + '\'' +
                ", replyBoard='" + replyBoard + '\'' +
                ", replyid='" + replyid + '\'' +
                ", sectiontitle='" + sectiontitle + '\'' +
                ", title='" + title + '\'' +
                ", topicDesc='" + topicDesc + '\'' +
                ", topicImg='" + topicImg + '\'' +
                ", topicName='" + topicName + '\'' +
                ", videoTopic=" + videoTopic +
                ", vid='" + vid + '\'' +
                ", topicSid='" + topicSid + '\'' +
                ", videosource='" + videosource + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.cover);
        dest.writeString(this.description);
        dest.writeInt(this.length);
        dest.writeString(this.m3u8Hd_url);
        dest.writeString(this.m3u8_url);
        dest.writeString(this.mp4Hd_url);
        dest.writeString(this.mp4_url);
        dest.writeInt(this.playCount);
        dest.writeInt(this.playersize);
        dest.writeString(this.ptime);
        dest.writeString(this.replyBoard);
        dest.writeString(this.replyid);
        dest.writeString(this.sectiontitle);
        dest.writeString(this.title);
        dest.writeString(this.topicDesc);
        dest.writeString(this.topicImg);
        dest.writeString(this.topicName);
        dest.writeParcelable(this.videoTopic, flags);
        dest.writeString(this.vid);
        dest.writeString(this.topicSid);
        dest.writeString(this.videosource);
    }

    public static class VideoTopic implements Parcelable {
        public static final Parcelable.Creator<VideoTopic> CREATOR = new Parcelable.Creator<VideoTopic>() {
            @Override
            public VideoTopic createFromParcel(Parcel source) {
                return new VideoTopic(source);
            }

            @Override
            public VideoTopic[] newArray(int size) {
                return new VideoTopic[size];
            }
        };
        public String alias;
        public String ename;
        public String tid;
        public String tname;

        public VideoTopic() {
        }

        protected VideoTopic(Parcel in) {
            this.alias = in.readString();
            this.ename = in.readString();
            this.tid = in.readString();
            this.tname = in.readString();
        }

        @Override
        public String toString() {
            return "VideoTopic{" +
                    "alias='" + alias + '\'' +
                    ", ename='" + ename + '\'' +
                    ", tid='" + tid + '\'' +
                    ", tname='" + tname + '\'' +
                    '}';
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.alias);
            dest.writeString(this.ename);
            dest.writeString(this.tid);
            dest.writeString(this.tname);
        }
    }
}
